//------------------------------------------------------------------------
// Abstract: Define of class Format
//
// Authoring: XiaoHanxiong
//
// Time: 2014.03.21
//
// Static test:
//
// Version history:
//		Ver_1.0 : 2014.03.21	XiaoHanxiong
//------------------------------------------------------------------------
#ifndef _Library_Format_h_
#define _Library_Format_h_

#include "stdafx.h"

namespace Library
{
	enum _LIBRARY Notation
	{
		Bin = 2,
		Oct = 8,
		Dec = 10,
		Hex = 16
	};

	class _LIBRARY Format
	{
	private:
		// Constructor
		Format();
		// Destructor
		~Format();

	public:
		// Lower/Upper case
		static void LowerA(string& str);
		static void LowerA(char& ch);
		static void UpperA(string& str);
		static void UpperA(char& ch);
		// Is alphabet/number
		bool IsLetterA(const string& str);
		bool IsLetterA(const char& ch);
		bool IsNumberA(const string& str);
		bool IsNumberA(const char& ch);

	public:
		// Number <==> Dec String
		static void NumToDecStringA(short in, string& str);
		static void NumToDecStringA(unsigned short in, string& str);
		static void NumToDecStringA(int in, string& str);
		static void NumToDecStringA(unsigned int in, string& str);
		static void NumToDecStringA(long in, string& str);
		static void NumToDecStringA(unsigned long in, string& str);
		static void NumToDecStringA(__int64 in, string& str);
		static void NumToDecStringA(unsigned __int64 in, string& str);
		static void NumToDecStringA(float in, string& str);
		static void NumToDecStringA(double in, string& str);
		// Dec String ==> Number
		static void DecStringToNumA(string& str, short& out);
		static void DecStringToNumA(string& str, unsigned short& out);
		static void DecStringToNumA(string& str, int& out);
		static void DecStringToNumA(string& str, unsigned int& out);
		static void DecStringToNumA(string& str, long& out);
		static void DecStringToNumA(string& str, unsigned long& out);
		static void DecStringToNumA(string& str, __int64& out);
		static void DecStringToNumA(string& str, unsigned __int64& out);
		static void DecStringToNumA(string& str, float& out);
		static void DecStringToNumA(string& str, double& out);

	public:
		// Number ==> Hex String
		static void NumToHexStringA(short in, string& str);
		static void NumToHexStringA(unsigned short in, string& str);
		static void NumToHexStringA(int in, string& str);
		static void NumToHexStringA(unsigned int in, string& str);
		static void NumToHexStringA(long in, string& str);
		static void NumToHexStringA(unsigned long in, string& str);
		static void NumToHexStringA(__int64 in, string& str);
		static void NumToHexStringA(unsigned __int64 in, string& str);
		// Hex String ==> Number
		static void HexStringToNumA(string& str, short& out);
		static void HexStringToNumA(string& str, unsigned short& out);
		static void HexStringToNumA(string& str, int& out);
		static void HexStringToNumA(string& str, unsigned int& out);
		static void HexStringToNumA(string& str, long& out);
		static void HexStringToNumA(string& str, unsigned long& out);
		static void HexStringToNumA(string& str, __int64& out);
		static void HexStringToNumA(string& str, unsigned __int64& out);


	public:
		// Number ==> Binary String
		static void NumToBinStringA(short in, string& str);
		static void NumToBinStringA(unsigned short in, string& str);
		static void NumToBinStringA(int in, string& str);
		static void NumToBinStringA(unsigned int in, string& str);
		static void NumToBinStringA(long in, string& str);
		static void NumToBinStringA(unsigned long in, string& str);
		static void NumToBinStringA(__int64 in, string& str);
		static void NumToBinStringA(unsigned __int64 in, string& str);
		// Binary String ==> Number
		static void BinStringToNumA(string& str, short& out);
		static void BinStringToNumA(string& str, unsigned short& out);
		static void BinStringToNumA(string& str, int& out);
		static void BinStringToNumA(string& str, unsigned int& out);
		static void BinStringToNumA(string& str, long& out);
		static void BinStringToNumA(string& str, unsigned long& out);
		static void BinStringToNumA(string& str, __int64& out);
		static void BinStringToNumA(string& str, unsigned __int64& out);


	public:
		// Number ==> Octal String
		static void NumToOctStringA(short in, string& str);
		static void NumToOctStringA(unsigned short in, string& str);
		static void NumToOctStringA(int in, string& str);
		static void NumToOctStringA(unsigned int in, string& str);
		static void NumToOctStringA(long in, string& str);
		static void NumToOctStringA(unsigned long in, string& str);
		static void NumToOctStringA(__int64 in, string& str);
		static void NumToOctStringA(unsigned __int64 in, string& str);
		// Octal String ==> Number
		static void OctStringToNumA(string& str, short& out);
		static void OctStringToNumA(string& str, unsigned short& out);
		static void OctStringToNumA(string& str, int& out);
		static void OctStringToNumA(string& str, unsigned int& out);
		static void OctStringToNumA(string& str, long& out);
		static void OctStringToNumA(string& str, unsigned long& out);
		static void OctStringToNumA(string& str, __int64& out);
		static void OctStringToNumA(string& str, unsigned __int64& out);

	};

}// _Library_

#endif